package com.web.portal.utils.file;

import java.io.File;
import java.io.FileOutputStream;

//文件工具类
public class FileUtil {
    public static void uploadFile(byte[] file,String filepath,String fileName) throws Exception {
        File targetFile=new File(filepath);
        //目录不存在则创建
        if(!targetFile.exists()){
            targetFile.mkdirs();
        }
        FileOutputStream out =new FileOutputStream(targetFile+fileName);
        out.write(file);
        out.flush();
        out.close();
    }
}
